# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=opensmtpd-table-redis
pkgver=1.0
pkgrel=0
pkgdesc="OpenSMTPD Redis tables"
url="https://github.com/OpenSMTPD/table-redis"
arch="all"
license="ISC"
makedepends="
	autoconf
	automake
	hiredis-dev
	"
subpackages="$pkgname-doc"
source="https://github.com/OpenSMTPD/table-redis/archive/$pkgver/opensmtpd-table-redis-$pkgver.tar.gz"
builddir="$srcdir/table-redis-$pkgver"
options="!check"  # upstream does not provide tests

prepare() {
	default_prepare
	./bootstrap
}

build() {
	CFLAGS="$CFLAGS -I /usr/include/hiredis" \
	./configure \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--sysconfdir=/etc/smtpd
	make
}

package() {
	make DESTDIR="$pkgdir" smtpdir="/usr/lib/opensmtpd" install
}

sha512sums="
4bb795ec08d56a1f8a901625bbe80396a41e94f484f44dac4bd7e6be92731392a8b75e21e643ef17e37b61fbf5d796da4b0a5278d7769927c7e7a0d11041587c  opensmtpd-table-redis-1.0.tar.gz
"
